<template>
  <div class="app-container">
    <div class="searchBox">
      <el-form :inline="true" :model="search" ref="searchForm">
        <el-form-item label="您的姓名" prop="name">
          <el-input
            v-model="search.name"
            placeholder="请输入您的姓名"
            clearable
            size="small"
            @keyup.enter.native="searchQuery"
          />
        </el-form-item>
        <el-form-item label="单位名称" prop="unitName">
          <el-input
            v-model="search.unitName"
            placeholder="请输入单位名称"
            clearable
            size="small"
            @keyup.enter.native="searchQuery"
          />
        </el-form-item>
        <el-form-item label="所属行业" prop="industry">
          <el-input
            v-model="search.industry"
            placeholder="请输入所属行业"
            clearable
            size="small"
            @keyup.enter.native="searchQuery"
          />
        </el-form-item>
        <el-form-item label="状态" prop="state">
          <el-select v-model="search.state">
            <el-option
              v-for="item in controlData.feedbackState"
              :key="item.code"
              :label="item.name"
              :value="item.code"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item style="margin-top: -2px">
          <el-button type="primary" @click="searchQuery">搜索</el-button>
          <el-button type="info" @click="search = {};searchQuery()">重置</el-button>
        </el-form-item>
      </el-form>
    </div>

    <!-- useFormPage情况下，formPage不指定，默认取当前目录下的create -->
    <qm-table
      :data="query"
      keyProp="id"
      :formOptions="{ labelWidth: '120px' }"
      :formValidate="defaultFormValidate"
      menuType="text"
      :showToolbar="false"
      isCustomForm
    >
      <qm-table-column field="name">您的姓名</qm-table-column>
      <qm-table-column field="unitName">单位名称</qm-table-column>
      <qm-table-column field="industry">所属行业</qm-table-column>
      <qm-table-column field="concatNumber">联系电话</qm-table-column>
      <qm-table-column field="workMailbox">工作邮箱</qm-table-column>
      <qm-table-column field="state">状态</qm-table-column>
      <qm-table-column field="remarks">备注</qm-table-column>

      <!-- 表格上面的工具栏，可自行添加和业务相关的按钮 -->
      <template v-slot:toolbar></template>

      <!-- 列表操作列，可自行添加和业务相关的按钮 -->
      <template v-slot:moreBtn="{ row }"></template>
      <template v-slot:form="{ models, model,disabled,controlData }">
        <create
          ref="create"
          :models="models"
          :model="model"
          :disabled="disabled"
          :controlData="controlData"
        ></create>
      </template>
    </qm-table>
  </div>
</template>

<script>
import Controller from "@/libs/framework/controller";
import Create from "./create";
export default class Instance extends Controller {
  onBeforeInit() {
    this.urls = {
      model: "/eip/feedback/getListModel",
      query: "/eip/feedback/query",
      save: "/eip/feedback/save",
      delete: "/eip/feedback/delete",
      entity: "/eip/feedback/getEntity"
    };
  }

  mixin() {
    return {
      components: {
        Create
      },
      data() {
        return {};
      },
      methods: {}
    };
  }
}
</script>

<style scoped lang="scss">
</style>